var time=new Date();

var week =["日","一","二","三","四","五","六"]
function gettime(year,month,date,day,hour,minute,second) {
    year=time.getFullYear();
    month=time.getMonth();
    date=time.getDate();
    day=time.getDay();
    hour=time.getHours();
    minute=time.getMinutes();
    second=time.getSeconds();

    if(month<10){
        month='0'+month
    }
     if(date<10){
        date='0'+date
    }
     if(hour<10){
        hour='0'+hour
    }
     if(minute<10){
        minute='0'+minute
    }
     if(second<10){
        second='0'+second
    }

    
    

    console.log(`现在时间是：${year}年${month+1}月${date}日 星期${week[day]}  ${hour}点${minute}分${second}秒`);
    
}
gettime();